class Solution
{
public:
    int minSteps(int n)
    {
        int written = 1;
        int copied = 0;
        int step = 0;
        while (written < n)
        {
            if ((n - written) % written == 0)
            {
                copied = written;
                ++step;
            }
            written += copied;
            ++step;
        }
        return step;
    }
};